<?php
require("../services/class/listaPlanillasOS.php");

$planillas = new class_listaPlanillasOS();
$params = array();
$params[0]->tipo = $_REQUEST["tipo"];
$params[0]->cod_obra_social = $_REQUEST["cod_obra_social"];
$result = $planillas->method_getPlanillas($params, $error);
if($params[0]->tipo == 'T'){
	$mostrar = "TODAS";
}
else if($params[0]->tipo == 'N'){
	$mostrar = "NUEVAS";
}
else if($params[0]->tipo == 'C'){
	$mostrar = "COBRADAS";
}
$data = $result->values;
$obraSocial = $data[0][2];
?>
<html>
<head>
	<title>Listado de Planillas Totales</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="es-es" />
	<link rel="stylesheet" type="text/css" href="style.css" />	
</head>
<body>
	<table width="1000px" align="center" border="0">
	<tr>
		<td valign="top">
			<font class="titulo">SOFAMBAR:<br/>Listado Planillas de <?php echo $obraSocial ?>, Mostrando: <?php echo $mostrar ?></font>
			<br/><br/>
		</td>
		
	</tr>
	</table>
	<table width="770px" align="center" border="1" cellpadding="0" cellspacing="0">
		<tr class='subtitulo' align="center">
			<td width="100">Fecha</td>
			<td width="320">Plan</td>
			<td width="150">Factura Nro</td>
			<td width="100">Tipo Fac.</td>
			<td width="100">Importe</td>
		</tr>	
	<?php	
		$i=1;
		foreach($data as $row){
	?>		
		<tr>
			<td class='elemento' align="center"><b><?php echo $i++ ?><br/>(<?php echo $row[1]?>)</b><br/></td>
			<td class='elemento' align="center">&nbsp;<?php echo utf8_encode($row[3])?></td>
			<td class='elemento' align="center"><?php echo $row[4]?></td>
			<td class='elemento' align="center"><?php echo $row[5]?></td>
			<td class='elemento' align="center"><?php echo $row[6]?></td>
		</tr>
	<?php
		}
	?>
	</table>
</body>
</html>